// Fill out your copyright notice in the Description page of Project Settings.


#include "SocketActor.h"

// Sets default values
ASocketActor::ASocketActor()
{
	PrimaryActorTick.bCanEverTick = true;
	//PrimaryActorTick.TickInterval = 30.0;
}

void ASocketActor::GetString(UVaRestRequestJSON* Request)
{

	if(Request->bIsValidJsonResponse)
	{
		FString reslut = Request->GetResponseContentAsString();
		UE_LOG(LogTemp, Log, TEXT("GET %s"), *reslut);

	}
}

// Called when the game starts or when spawned
void ASocketActor::BeginPlay()
{
	Super::BeginPlay();
	Subsystem = UGameInstance::GetSubsystem<UVaRestSubsystem>(UVaRestSubsystem);
	//FName FunctionName = TEXT("GetString");
	//Response.BindUFunction(this, FunctionName);
}

// Called every frame
void ASocketActor::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
	//FString URL = TEXT("http://127.0.0.1/glde.txt");
	
	//Subsystem.CallURL(URL, EVaRestRequestVerb::GET, EVaRestRequestContentType::x_www_form_urlencoded_url, NULL, Response);

}

